<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index111</title>
</head>
<body>
    <h3>SSE 1</h3>
<script>
    // 初始化.参数为url
    var sse = new EventSource("hello3")
    sse.onmessage = function (e) {
        console.log("data: ",e.data, e);
        // 关闭自动重连
        if(e.data === 'flux data--3'){
            sse.close();
        }
    }
</script>
</body>
</html>